package com.shixi.shixitraining.shixitraining.ui.tabmine.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.shixi.shixitraining.shixitraining.ui.tabapply.fragment.ApplyEmploymentFragment;
import com.shixi.shixitraining.shixitraining.ui.tabapply.fragment.ApplyJobFragment;
import com.shixi.shixitraining.shixitraining.ui.tabapply.fragment.ApplyTrainingFragment;

/**
 * Created by shenyan on 2018/7/17.
 */

public class MyApplyPagerAdapter extends FragmentPagerAdapter {

    private String titles[] = {"实训项目","就业岗位","职业培训"};

    public MyApplyPagerAdapter(FragmentManager fm) {
        super(fm);
    }


    Fragment fragment = null;
    @Override
    public Fragment getItem(int position) {
     if (titles[position].equals("实训项目")){
         fragment=new ApplyTrainingFragment();
     }else if (titles[position].equals("就业岗位")){
         fragment=new ApplyEmploymentFragment();
     }else if (titles[position].equals("职业培训")){
         fragment=new ApplyJobFragment();
     }

     return fragment;

    }

    @Override
    public int getCount() {
        return titles.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }


}
